# -*- coding: UTF-8 -*-
# @Project ：luffycity 
# @File    ：模拟设计游戏.py
# @Author  ：于金龙
# @IDE     ：PyCharm 
# @Date    ：2024/4/8 8:13
# 创建多个类并且对值进行修改
class Police:
    def __init__(self, name, role):
        self.name = name
        if role == "队员":
            self.hit_points = 200
        else:
            self.hit_points = 500

    def status(self):
        message = "警察{}的血值为{}".format(self.name, self.hit_points)
        print(message)

    def bomb(self, t_list):
        for t in t_list:
            t.bool -= 8
            t.show_status()


class Terrorist:
    def __init__(self, name, bool=300):
        self.bool = bool
        self.name = name

    def shoot(self, police_object):
        police_object.hit_points -= 5
        police_object.status()

    def strafe(self, police_object_list):
        for police_object in police_object_list:
            police_object.hit_points -= 8
            police_object.status()

    def show_status(self):
        message = "恐怖分子{}，血量值为{}".format(self.name, self.bool)
        print(message)


if __name__ == '__main__':
    r1 = Police("于金龙", "队长")
    r2 = Police("r1", "队员")

    s1 = Terrorist("T1")
    s2 = Terrorist("T1")
    # 警察炸恐怖份子
    r1.bomb([s1, s2])
    # 恐怖分子扫射警察
    s1.strafe([r1, r2])
    # 恐怖分子设计
    s1.shoot(r2)
